<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <title>分页界面</title>
    <link rel="stylesheet" type="text/css" href="${s.base}/lib/layui/css/layui.css"/>
    <link rel="stylesheet" type="text/css" href="${s.base}/css/base/index.css"/>
    <link rel="stylesheet" type="text/css" href="${s.base}/css/base/theme/theme.css"/>
</head>
<body>
<div class="wrap-container clearfix">
    <div class="column-content-detail">
        <form class="layui-form">
            <div class="search-cont clearfix" id="tool">
                <div class="operation-btn-cont">
                    <div class="operright cyt-retract-close hideMenu"> 收起筛选<i class="iconfont">&#xe658;</i></div>
                    <div class="operright cyt-retract-open showMenu" style="display: none;"> 展开筛选<i class="iconfont">&#xe936;</i></div>
                    <button class="layui-btn layui-btn-normal layui-btn-mid" type="button" id="addBtn"><i class="iconfont marr5">&#xe65e;</i>新建</button>
                    <button class="layui-btn layui-btn-normal layui-btn-mid" type="button" id="syncRedis"><i class="iconfont marr5">&#xe65e;</i>缓存</button>
                    <div class="triangle-bottom"></div>
                    <div class="triangle-top"></div>
                </div>
                <div class="search-details">
                    <div class="layui-form-item marb5">
                        <!--search开始-->
                        <div class="layui-inline">
                            <label class="layui-form-label" style="width:80px!important;">社团名称：</label>
                            <div class="layui-input-inline">
                                <input type="text" id="title" name="title" placeholder="请输入社团名称" autocomplete="off" class="layui-input">
                            </div>
                        </div>

                        <!--search结束-->
                        <div class="layui-inline marl8">
                            <button class="layui-btn layui-btn-normal" type="button" id="searchBtn">搜索</button>
                            <button class="layui-btn layui-btn-normal" type="button" id="resetBtn">重置</button>
                        </div>
                    </div>
                </div>
            </div>
        </form>
        <div class="society-recruit-ctn " id="content">
        </div>
        <div id="page">
        </div>
    </div>
</div>
<!--操作-->
<script src="${s.base}/lib/layui/layui.js" type="text/javascript" charset="utf-8"></script>
<script src="${s.base}/js/common.js" type="text/javascript" charset="utf-8"></script>
<script src="${s.base}/mobile/js/common.js" type="text/javascript" charset="utf-8"></script>
<script>


    var applyId='${applyId}';
    var page = null;
    var baseutil = null;
    var dialog = null;
    var form = null;
    var curr = 1;// 当前页，初始值设为 1
    var limit = 10;// 每页条数，初始值设为 10
    var total;// 总记录数
    layui.use(['form', 'jquery','table', 'fileUtil', 'dialog', 'layer','page', 'layedit', 'baseutil','laydate','upload'], function () {
        var $ = layui.jquery,
            page = layui.page,
            baseutil = layui.baseutil,
            dialog = layui.dialog,
            table = layui.table;
        $(document).ready(function () {
            getInfo();// 获取数据
            toPage();// 进行分页

        });

        function getInfo() {
            var title = $("#title").val();
            $.ajax({
                type: "post",
                url: "/work/associationNew/wxassociationnew/page",
                async: false,// 设置同步请求，加载数据前锁定浏览器
                dataType: 'json',
                data: {
                    "page": curr, // 查询页码
                    "limit": limit, // 每页条数
                    "title":title,
                    "applyId":applyId,
                    "title":title

                },
                success: successFu
            });
        }

        // 数据请求成功
        function successFu(pager) {
            $("#content").html("");

            total = pager.count;
            if (pager.total == 0) {
                return;
            }
            var text = '<ul>';
            $.each(pager.data, function (i, item) {
                var  textStr = item.title +'招新开始了,同学们来加入吧';
                var begin1 = new Date(item.beginDate);
                var end1 = new Date(item.endDate);
                var begin = FormatMyTime(begin1, "yyyy-MM-dd");
                var end = FormatMyTime(end1, "yyyy-MM-dd");

                var  data ='开放日期:'+begin+'至'+end;
                var  time = '开放时间段:'+item.beginTime+'至'+item.endTime;

                text+= '<li class="clearfix">';
                if(item.status =="3"){
                    text+='<div class="quest-status quest-status-yellow">编辑中</div>';
                }else if (item.status =="2"){
                    text+='<div class="quest-status quest-status-grey">已结束</div>';
                }else if (item.status =="1"){
                    text+='<div class="quest-status quest-status-blue">已发布</div>';
                }else if (item.status =="0"){
                    text+='<div class="quest-status quest-status-orange">即将开始</div>';
                }
                text+= ' <div class="society-recruit-left">'+
                    '<h1 class="ellipsis detail_association" data-id='+item.id+'>'+textStr+'</h1>'+
                    ' <h2 class="ellipsis">'+data+'</h2>'+
                    '<h2 class="ellipsis">'+time+'</h2>'+
                    '</div>'+
                    '<div class="society-recruit-right clearfix">'+
                    '<ul>';
                if(item.status =="3"){
                    text+='<li class="society-border-blue edit-association" data-id='+item.id+'><i class="iconfont">&#xe679;</i><span>编辑</span></li>';
                    text+='<li class="noclick" data-id='+item.id+'><i class="iconfont">&#xe677;</i><span>统计</span></li>';
                    text+= '<li class="noclick" data-id='+item.id+'><i class="iconfont">&#xe65d;</i><span>结束</span></li>';
                    text+='<li class="society-border-blue delect-association" data-id='+item.id+'><i class="iconfont">&#xe65b;</i><span>删除</span></li>';
                }else if (item.status =="2"){
                    text+='<li class="noclick" data-id='+item.id+'><i class="iconfont">&#xe679;</i><span>编辑</span></li>';
                    text+='<li class="society-border-blue call-association" data-id='+item.id+'><i class="iconfont">&#xe677;</i><span>统计</span></li>';
                    text+= '<li class="noclick" data-id='+item.id+'><i class="iconfont">&#xe65d;</i><span>结束</span></li>';
                    text+='<li class="society-border-blue delect-association" data-id='+item.id+'><i class="iconfont">&#xe65b;</i><span>删除</span></li>';

                }else if (item.status =="1"||item.status=="0"){
                    text+='<li class=" noclick" data-id='+item.id+'><i class="iconfont">&#xe679;</i><span>编辑</span></li>';
                    text+='<li class="society-border-blue call-association" data-id='+item.id+'><i class="iconfont">&#xe677;</i><span>统计</span></li>';
                    text+= '<li class="society-border-blue end-association" data-id='+item.id+'><i class="iconfont">&#xe65d;</i><span>结束</span></li>';
                    text+='<li class=" noclick" data-id='+item.id+'><i class="iconfont">&#xe65b;</i><span>删除</span></li>';
                }
                text+= '</ul>'+
                    '</div>'+
                    '</li>';
            });
            text +='</ul>';
            $("#content").html(text);
        }
        // 编辑社团
        $('#content').on('click','.edit-association', function () {
            var id = $(this).attr("data-id");
            var menuId=parent.getTabId();
            //page.editPopup('/work/association/wxassociation/getEdit?applyId='+applyId+'&id=' + id, '编辑');
            page.edit("associationEdit","/work/associationNew/wxassociationnew/getEdit?applyId="+applyId+'&id=' + id+"&parentMenuId="+menuId,"招新编辑");
        });

        $("#syncRedis").on("click",function () {
            baseutil.post('/work/associationNew/wxassociationnew/syncCache', "", function (res) {
                if (res.code == "0") {
                    dialog.msg("缓存成功");
                } else {
                    dialog.msg(res.msg);
                }
            });
        });

        // 查看社团详情
        $('#content').on('click','.detail_association', function () {
            var id = $(this).attr("data-id");
            var menuId=parent.getTabId();
            //page.editPopup('/work/association/wxassociation/getEdit?applyId='+applyId+'&id=' + id, '编辑');
            page.edit("associationdetail","/work/associationNew/wxassociationnew/getDetail?applyId="+applyId+'&id=' + id+"&parentMenuId="+menuId,"招新详情");
        });

        $('#addBtn').bind('click', function () {
            var id=parent.getTabId();
            page.edit("associationEdit","/work/associationNew/wxassociationnew/getEdit?applyId="+applyId+"&parentMenuId="+id,"新建社团招新");
        });

        //删除操作
        $('#content').on('click','.delect-association', function () {
            var id = $(this).attr("data-id");
            page.delete('/work/associationNew/wxassociationnew/remove', {"id": $(this).attr("data-id")}, "您确定要删除吗？", function () {
                getInfo();// 获取数据
                toPage();// 进行分页
            });
        });
        //招新结束
        $('#content').on('click','.end-association', function () {
            var id = $(this).attr("data-id");
            page.delete('/work/associationNew/wxassociationnew/endAssociation', {"id": $(this).attr("data-id")}, "您确定要结束吗？", function () {
                getInfo();// 获取数据
                toPage();// 进行分页
            });
        });

        //招新统计
        $('#content///////////////////////////////////////////////////////////////////////////////////\n' +
            '// 弹窗调用接口封装\n' +
            '//开发人：虞胜强\n' +
            '//开发时间：2019/3/25\n' +
            '///////////////////////////////////////////////////////////////////////////////////\n' +
            'layui.define([\'jquery\', \'layer\',\'validUtil\'], function (exports) {\n' +
            '    var $ = layui.jquery,\n' +
            '        validUtil = layui.validUtil;\n' +
            '    var layer = parent.layer === undefined ? layui.layer : top.layer;\n' +
            '    var dialog = {\n' +
            '        /***\n' +
            '         * 询问框方法\n' +
            '         * @param message 内容\n' +
            '         * @param successFn 点击‘确定’回调方法\n' +
            '         * @param cancelFn 点击‘取消’回调方法\n' +
            '         */\n' +
            '        confirm: function (message,successFn,cancelFn) {\n' +
            '            dialog.confirmTitleMessage("信息",message,successFn,cancelFn);\n' +
            '        },\n' +
            '        /***\n' +
            '         * 询问框方法\n' +
            '         * @param title 标题\n' +
            '         * @param message 内容\n' +
            '         * @param successFn 点击‘确定’回调方法\n' +
            '         * @param cancelFn 点击‘取消’回调方法\n' +
            '         */\n' +
            '        confirmTitleMessage: function (title,message,successFn,cancelFn) {\n' +
            '            dialog.confirmBase(title,message,[\'确定\', \'取消\'],successFn,cancelFn);\n' +
            '        },\n' +
            '        /***\n' +
            '         * 询问框方法\n' +
            '         * @param message 内容\n' +
            '         * @param btn 按钮\n' +
            '         * @param successFn 点击‘确定’回调方法\n' +
            '         * @param cancelFn 点击‘取消’回调方法\n' +
            '         */\n' +
            '        confirmMessageBtn: function (message,btn,successFn,cancelFn) {\n' +
            '            dialog.confirmBase("信息",message,btn,successFn,cancelFn);\n' +
            '        },\n' +
            '        /***\n' +
            '         * 询问框方法\n' +
            '         * @param title 标题\n' +
            '         * @param message 内容\n' +
            '         * @param btn 按钮\n' +
            '         * @param successFn 点击‘确定’回调方法\n' +
            '         * @param cancelFn 点击‘取消’回调方法\n' +
            '         */\n' +
            '        confirmBase: function (title,message,btn,successFn,cancelFn) {\n' +
            '            layer.confirm(message, {\n' +
            '                title:title,\n' +
            '                btn: btn,\n' +
            '                shade: [0.1, \'#fff\']\n' +
            '            }, function (index) {\n' +
            '                layer.close(index);\n' +
            '                if(typeof successFn==\'function\'){\n' +
            '                    successFn();\n' +
            '                }\n' +
            '            }, function (index) {\n' +
            '                layer.close(index);\n' +
            '                if(typeof cancelFn==\'function\'){\n' +
            '                    cancelFn();\n' +
            '                }\n' +
            '            });\n' +
            '        },\n' +
            '        /**\n' +
            '         * 提示框\n' +
            '         *\n' +
            '         * @param msg 提示内容\n' +
            '         * @author shengQiang yu\n' +
            '         * @date 2019-03-05 15:40\n' +
            '         */\n' +
            '        msg: function (msg) {\n' +
            '            layer.msg(msg, {time: 1 * 1000});\n' +
            '        },\n' +
            '        /**\n' +
            '         * 弹窗页面\n' +
            '         *\n' +
            '         * @param title 标题\n' +
            '         * @param url 连接\n' +
            '         * @param width 弹窗宽\n' +
            '         * @param height 弹窗高\n' +
            '         * @author shengQiang yu\n' +
            '         * @date 2019-03-11 9:44\n' +
            '         */\n' +
            '        popUpPage: function (title, url, width, height,successFn) {\n' +
            '            if (validUtil.isEmpty(title)) {\n' +
            '                title = false;\n' +
            '            };\n' +
            '            if (validUtil.isEmpty(url)) {\n' +
            '                url = "404.html";\n' +
            '            };\n' +
            '            if (validUtil.isEmpty(width)) {\n' +
            '                width = \'700px\';\n' +
            '            };\n' +
            '            if (validUtil.isEmpty(height)) {\n' +
            '                height = \'620px\';\n' +
            '            };\n' +
            '            var index = layer.open({\n' +
            '                type: 2,\n' +
            '                title: title,\n' +
            '                area: [width, height],\n' +
            '                fixed: false, //不固定\n' +
            '                maxmin: true,\n' +
            '                content: url,\n' +
            '                success: function (layero, index) {\n' +
            '                    if(typeof successFn==\'function\'){\n' +
            '                        successFn(layer, index);\n' +
            '                    }\n' +
            '                }\n' +
            '            });\n' +
            '        },\n' +
            '        /**\n' +
            '         * 基础单选选择器弹窗页面\n' +
            '         *\n' +
            '         * @param title 标题\n' +
            '         * @param url 连接\n' +
            '         * @param successFn 成功回调\n' +
            '         * @param width 弹窗宽\n' +
            '         * @param height 弹窗高\n' +
            '         * @author shengQiang yu\n' +
            '         * @date 2019-03-11 9:44\n' +
            '         */\n' +
            '        popUpSingleSelect: function (title, url,successFn, width, height) {\n' +
            '            if (validUtil.isEmpty(title)) {\n' +
            '                title = "选择器";\n' +
            '            }\n' +
            '            if (validUtil.isEmpty(width)) {\n' +
            '                width = 380;\n' +
            '            }\n' +
            '            if (validUtil.isEmpty(height)) {\n' +
            '                height = 560;\n' +
            '            }\n' +
            '            dialog.popUpPage(title,"/base/selector/single?url=" + url,width+\'px\',height+\'px\', function (layer, index) {\n' +
            '                var body = layer.getChildFrame(\'body\', index);\n' +
            '                body.find("#save").bind("click", function () {\n' +
            '                    var id = body.find("#resultId").val();\n' +
            '                    var name = body.find("#resultName").val();\n' +
            '                    if(typeof successFn==\'function\'){\n' +
            '                        successFn(id,name,layer,index);\n' +
            '                    }\n' +
            '                    parent.layer.close(index);\n' +
            '                });\n' +
            '                body.find("#cancel").bind("click", function () {\n' +
            '                    parent.layer.close(index);\n' +
            '                });\n' +
            '            });\n' +
            '        },\n' +
            '        /**\n' +
            '         * 基础多选选择器弹窗页面\n' +
            '         *\n' +
            '         * @param title 标题\n' +
            '         * @param url 连接\n' +
            '         * @param successFn 成功回调\n' +
            '         * @param initIds 初始化选中对象id集合，多个用“,”隔开\n' +
            '         * @param width 弹窗宽\n' +
            '         * @param height 弹窗高\n' +
            '         * @author shengQiang yu\n' +
            '         * @date 2019-03-11 9:44\n' +
            '         */\n' +
            '        popUpMultSelect: function (title, url,successFn,initIds,width, height) {\n' +
            '            //初始化选中对象id集合\n' +
            '            var params = [];\n' +
            '            params.push(initIds);\n' +
            '            //初始化id值\n' +
            '            parent.cytSetSelectObjctParams(params);\n' +
            '\n' +
            '            if (validUtil.isEmpty(title)) {\n' +
            '                title = "选择器";\n' +
            '            }\n' +
            '            if (validUtil.isEmpty(width)) {\n' +
            '                width = 380;\n' +
            '            }\n' +
            '            if (validUtil.isEmpty(height)) {\n' +
            '                height = 560;\n' +
            '            }\n' +
            '            dialog.popUpPage(title,"/base/selector/mult?url=" + url,width+\'px\',height+\'px\', function (layer, index) {\n' +
            '                var body = layer.getChildFrame(\'body\', index);\n' +
            '                body.find("#save").bind("click", function () {\n' +
            '                    var id = body.find("#resultId").val();\n' +
            '                    var name = body.find("#resultName").val();\n' +
            '                    if(typeof successFn==\'function\'){\n' +
            '                        successFn(id,name,layer,index);\n' +
            '                    }\n' +
            '                    parent.layer.close(index);\n' +
            '                });\n' +
            '                body.find("#cancel").bind("click", function () {\n' +
            '                    parent.layer.close(index);\n' +
            '                });\n' +
            '            });\n' +
            '        },\n' +
            '        /**\n' +
            '         * 学校应用多选选择器弹窗页面(仿e智云）\n' +
            '         *\n' +
            '         * @param ids 展示id值的id\n' +
            '         * @param title 弹窗标题\n' +
            '         * @param names 展示name值的id\n' +
            '         * @param initIds 选中值id显示位置\n' +
            '         * @param successFn 成功回调\n' +
            '         * @author shengQiang yu\n' +
            '         * @date 2019-03-11 9:44\n' +
            '         */\n' +
            '        popUpSchoolApplyMultSelect: function (ids,names,title,initIds,successFn){\n' +
            '            if(validUtil.isEmpty(title)){\n' +
            '                title="学校选择"\n' +
            '            }\n' +
            '            dialog.popUpBaseCytMultSelectNoTree(initIds,title,"学校,应用","请输入内容","/wx/wxeducationuser/getAllTeacherList",function (idValues,nameValues) {\n' +
            '                if(validUtil.isNotEmpty(ids)){\n' +
            '                    $("#" + ids).val(idValues);\n' +
            '                    $("#" + ids).html(idValues);\n' +
            '                }\n' +
            '                if(validUtil.isNotEmpty(names)){\n' +
            '                    $("#" + names).val(nameValues);\n' +
            '                    $("#" + names).html(nameValues);\n' +
            '                    $("#" + names).attr("title", nameValues);\n' +
            '                }\n' +
            '                if (typeof successFn == \'function\') {\n' +
            '                    successFn(idValues,nameValues);\n' +
            '                }\n' +
            '            });\n' +
            '        },\n' +
            '\n' +
            '\n' +
            '\n' +
            '        /**\n' +
            '         * 监巡考老师选择器\n' +
            '         *\n' +
            '         * @param ids 展示id值的id\n' +
            '         * @param title 弹窗标题\n' +
            '         * @param names 展示name值的id\n' +
            '         * @param initIds 选中值id显示位置\n' +
            '         * @param successFn 成功回调\n' +
            '         * @author hanjun\n' +
            '         * @date 2019-09-26\n' +
            '         */\n' +
            '        popUpNewTeacherApplyMultSelect: function (type,ksId,ids,names,title,initIds,successFn){\n' +
            '            debugger;\n' +
            '            if(validUtil.isEmpty(title)){\n' +
            '                title="学校选择"\n' +
            '            }\n' +
            '            dialog.popUpBaseCytMultSelectNoTree(initIds,title,"姓名,工号","请输入内容","/work/kwmanagement/kwteachersetting/getAllTeacherListjxk?type="+type+"&ksId="+ksId,function (idValues,nameValues) {\n' +
            '                if(validUtil.isNotEmpty(ids)){\n' +
            '                    $("#" + ids).val(idValues);\n' +
            '                    $("#" + ids).html(idValues);\n' +
            '                }\n' +
            '                if(validUtil.isNotEmpty(names)){\n' +
            '                    $("#" + names).val(nameValues);\n' +
            '                    $("#" + names).html(nameValues);\n' +
            '                    $("#" + names).attr("title", nameValues);\n' +
            '                }\n' +
            '                if (typeof successFn == \'function\') {\n' +
            '                    successFn(idValues,nameValues);\n' +
            '                }\n' +
            '            });\n' +
            '        },\n' +
            '\n' +
            '\n' +
            '\n' +
            '\n' +
            '        /**\n' +
            '         * 教师多选取\n' +
            '         *\n' +
            '         * @param ids 展示id值的id\n' +
            '         * @param title 弹窗标题\n' +
            '         * @param names 展示name值的id\n' +
            '         * @param initIds 选中值id显示位置\n' +
            '         * @param successFn 成功回调\n' +
            '         * @author hanjun\n' +
            '         * @date 2019-09-26\n' +
            '         */\n' +
            '        popUpScTeacherApplyMultSelect: function (ids,names,applyId,title,initIds,successFn){\n' +
            '            debugger;\n' +
            '            if(validUtil.isEmpty(title)){\n' +
            '                title="学校选择"\n' +
            '            }\n' +
            '            dialog.popUpBaseCytMultSelectNoTree(initIds,title,"姓名,工号","请输入内容","/wx/wxeducationuser/getAllTeacherList?applyId="+applyId,function (idValues,nameValues) {\n' +
            '                if(validUtil.isNotEmpty(ids)){\n' +
            '                    $("#" + ids).val(idValues);\n' +
            '                    $("#" + ids).html(idValues);\n' +
            '                }\n' +
            '                if(validUtil.isNotEmpty(names)){\n' +
            '                    $("#" + names).val(nameValues);\n' +
            '                    $("#" + names).html(nameValues);\n' +
            '                    $("#" + names).attr("title", nameValues);\n' +
            '                }\n' +
            '                if (typeof successFn == \'function\') {\n' +
            '                    successFn(idValues,nameValues);\n' +
            '                }\n' +
            '            });\n' +
            '        },\n' +
            '\n' +
            '\n' +
            '        /**\n' +
            '         * 座位选择器\n' +
            '         *\n' +
            '         * @param ids 展示id值的id\n' +
            '         * @param title 弹窗标题\n' +
            '         * @param names 展示name值的id\n' +
            '         * @param initIds 选中值id显示位置\n' +
            '         * @param successFn 成功回调\n' +
            '         * @author hanjun\n' +
            '         * @date 2019-09-26\n' +
            '         */\n' +
            '        popUpSeatNumApplyMultSelect: function (ksId,kcId,ids,names,title,initIds,successFn){\n' +
            '            if(validUtil.isEmpty(title)){\n' +
            '                title="座位选择"\n' +
            '            }\n' +
            '            dialog.popUpBaseCytMultSelectNoTree(initIds,title,"考场,座位","请输入内容","/work/kwmanagement/kwteachersetting/getAllStudentSeatNum?ksId="+ksId+"&kcId="+kcId,function (idValues,nameValues) {\n' +
            '                if(validUtil.isNotEmpty(ids)){\n' +
            '                    $("#" + ids).val(idValues);\n' +
            '                    $("#" + ids).html(idValues);\n' +
            '                }\n' +
            '                if(validUtil.isNotEmpty(names)){\n' +
            '                    $("#" + names).val(nameValues);\n' +
            '                    $("#" + names).html(nameValues);\n' +
            '                    $("#" + names).attr("title", nameValues);\n' +
            '                }\n' +
            '                if (typeof successFn == \'function\') {\n' +
            '                    if(idValues.indexOf(",")>0){\n' +
            '                        dialog.msg("请选择单个座位");\n' +
            '                    }else {\n' +
            '                        successFn(idValues,nameValues);\n' +
            '                    }\n' +
            '\n' +
            '                }\n' +
            '            });\n' +
            '        },\n' +
            '\n' +
            '\n' +
            '\n' +
            '        /**\n' +
            '         * 科目多选择器\n' +
            '         *\n' +
            '         * @param ids 展示id值的id\n' +
            '         * @param title 弹窗标题\n' +
            '         * @param names 展示name值的id\n' +
            '         * @param initIds 选中值id显示位置\n' +
            '         * @param successFn 成功回调\n' +
            '         * @author hanjun\n' +
            '         * @date 2019-09-26\n' +
            '         */\n' +
            '        popUpScSubjectApplyMultSelect: function (ids,names,title,initIds,successFn){\n' +
            '            if(validUtil.isEmpty(title)){\n' +
            '                title="科目选择"\n' +
            '            }\n' +
            '            debugger;\n' +
            '            dialog.popUpBaseCytMultSelectNoTree(initIds,title,"名称,代码值","请输入科目名称","/sysDict/AllSublist",function (idValues,nameValues) {\n' +
            '                if(validUtil.isNotEmpty(ids)){\n' +
            '                    $("#" + ids).val(idValues);\n' +
            '                    $("#" + ids).html(idValues);\n' +
            '                }\n' +
            '                if(validUtil.isNotEmpty(names)){\n' +
            '                    $("#" + names).val(nameValues);\n' +
            '                    $("#" + names).html(nameValues);\n' +
            '                    $("#" + names).attr("title", nameValues);\n' +
            '                }\n' +
            '                if (typeof cytSelectMoreCourseCallBack == \'function\') {\n' +
            '                    cytSelectMoreCourseCallBack(nameValues);\n' +
            '                }\n' +
            '                debugger;\n' +
            '\n' +
            '                if (typeof successFn == \'function\') {\n' +
            '                    successFn(idValues,nameValues);\n' +
            '                }\n' +
            '            });\n' +
            '        },\n' +
            '\n' +
            '\n' +
            '\n' +
            '\n' +
            '\n' +
            '\n' +
            '        /**\n' +
            '         * 用户多选选择器弹窗页面(仿e智云）\n' +
            '         *\n' +
            '         * @param ids 展示id值的id\n' +
            '         * @param title 弹窗标题\n' +
            '         * @param names 展示name值的id\n' +
            '         * @param initIds 选中值id显示位置\n' +
            '         * @param successFn 成功回调\n' +
            '         * @author shengQiang yu\n' +
            '         * @date 2019-03-11 9:44\n' +
            '         */\n' +
            '        popUpUserMultSelect: function (ids,names,title,initIds,successFn){\n' +
            '            if(validUtil.isEmpty(title)){\n' +
            '                title="用户选择"\n' +
            '            }\n' +
            '            dialog.popUpBaseCytMultSelect(initIds,title,"姓名,部门","请输入内容","/sysOrganization/dTreeList","/sysOrgUser/selector",function (idValues,nameValues) {\n' +
            '                if(validUtil.isNotEmpty(ids)){\n' +
            '                    $("#" + ids).val(idValues);\n' +
            '                    $("#" + ids).html(idValues);\n' +
            '                }\n' +
            '                if(validUtil.isNotEmpty(names)){\n' +
            '                    $("#" + names).val(nameValues);\n' +
            '                    $("#" + names).html(nameValues);\n' +
            '                    $("#" + names).attr("title", nameValues);\n' +
            '                }\n' +
            '                if (typeof successFn == \'function\') {\n' +
            '                    successFn(idValues,nameValues);\n' +
            '                }\n' +
            '            });\n' +
            '        },\n' +
            '        /**\n' +
            '         * 基础多选选择器弹窗页面(仿e智云）\n' +
            '         *\n' +
            '         * @param initIds 选中值id显示位置\n' +
            '         * @param title 弹窗标题\n' +
            '         * @param selectTitle 展示选项名称，多个以“，”隔开\n' +
            '         * @param seacherTip 搜索提示\n' +
            '         * @param treeUrl 左边树数据url接口\n' +
            '         * @param dataUrl 中间数据url接口\n' +
            '         * @author shengQiang yu\n' +
            '         * @date 2019-03-11 9:44\n' +
            '         */\n' +
            '        popUpBaseCytMultSelect: function (initIds,title,selectTitle,seacherTip, treeUrl, dataUrl,successFn) {\n' +
            '            //初始化选中对象id集合\n' +
            '            var params = [];\n' +
            '            params.push(initIds);//初始化选中对象id集合\n' +
            '            params.push(selectTitle);//标题名称\n' +
            '            params.push(seacherTip);//搜索提示\n' +
            '            params.push(treeUrl);//左边树url接口\n' +
            '            params.push(dataUrl);//中间数据url接口\n' +
            '            //初始化id值\n' +
            '            parent.cytSetSelectObjctParams(params);\n' +
            '            if (validUtil.isEmpty(title)) {\n' +
            '                title = "选择器";\n' +
            '            }\n' +
            '            dialog.popUpPage(title,"/base/selector/cytMult",\'900px\',\'630px\', function (layer, index) {\n' +
            '                var body = layer.getChildFrame(\'body\', index);\n' +
            '                body.find("#save").bind("click", function () {\n' +
            '                    var idValues = null;\n' +
            '                    var nameValues = null;\n' +
            '                    body.find("#showTableRight tr").each(function (i, e) {\n' +
            '                        var id = $(e).find("input[name=\'id\']").val();\n' +
            '                        var name = $(e).find("input[name=\'name\']").val();\n' +
            '                        var number = $(e).find("input[name=\'number\']").val();\n' +
            '                        if (idValues == null || idValues == "") {\n' +
            '                            idValues = id;\n' +
            '                        } else {\n' +
            '                            idValues += "," + id;\n' +
            '                        }\n' +
            '                        if (nameValues == null || nameValues == "") {\n' +
            '                            nameValues = name;\n' +
            '                        } else {\n' +
            '                            nameValues += "," + name;\n' +
            '                        }\n' +
            '\n' +
            '                    });\n' +
            '                    if(typeof successFn==\'function\'){\n' +
            '                        successFn(idValues,nameValues,layer,index);\n' +
            '                    }\n' +
            '                    parent.layer.close(index);\n' +
            '                });\n' +
            '                body.find("#cancel").bind("click", function () {\n' +
            '                    parent.layer.close(index);\n' +
            '                });\n' +
            '            });\n' +
            '        },\n' +
            '        /**\n' +
            '         * 基础多选选择器无左边树弹窗页面(仿e智云）\n' +
            '         *\n' +
            '         * @param initIds 选中值id显示位置\n' +
            '         * @param title 弹窗标题\n' +
            '         * @param selectTitle 展示选项名称，多个以“，”隔开\n' +
            '         * @param seacherTip 搜索提示\n' +
            '         * @param treeUrl 左边树数据url接口\n' +
            '         * @param dataUrl 中间数据url接口\n' +
            '         * @author shengQiang yu\n' +
            '         * @date 2019-03-11 9:44\n' +
            '         */\n' +
            '        popUpBaseCytMultSelectNoTree: function (initIds,title,selectTitle,seacherTip, dataUrl,successFn) {\n' +
            '            //初始化选中对象id集合\n' +
            '            var params = [];\n' +
            '            debugger;\n' +
            '            params.push(initIds);//初始化选中对象id集合\n' +
            '            params.push(selectTitle);//标题名称\n' +
            '            params.push(seacherTip);//搜索提示\n' +
            '            params.push(dataUrl);//中间数据url接口\n' +
            '            //初始化id值\n' +
            '            parent.cytSetSelectObjctParams(params);\n' +
            '            if (validUtil.isEmpty(title)) {\n' +
            '                title = "选择器";\n' +
            '            }\n' +
            '            dialog.popUpPage(title,"/base/selector/cytMultSelectorNoTree",\'660px\',\'609px\', function (layer, index) {\n' +
            '                var body = layer.getChildFrame(\'body\', index);\n' +
            '                body.find("#save").bind("click", function () {\n' +
            '                    var idValues = null;\n' +
            '                    var nameValues = null;\n' +
            '                    body.find("#showTableRight tr").each(function (i, e) {\n' +
            '                        var obj = {};\n' +
            '                        var id = $(e).find("input[name=\'id\']").val();\n' +
            '                        var name = $(e).find("input[name=\'name\']").val();\n' +
            '                        if (idValues == null || idValues == "") {\n' +
            '                            idValues = id;\n' +
            '                        } else {\n' +
            '                            idValues += "," + id;\n' +
            '                        }\n' +
            '                        if (nameValues == null || nameValues == "") {\n' +
            '                            nameValues = name;\n' +
            '                        } else {\n' +
            '                            nameValues += "," + name;\n' +
            '                        }\n' +
            '                    });\n' +
            '                    if(typeof successFn==\'function\'){\n' +
            '                        successFn(idValues,nameValues,layer,index);\n' +
            '                    }\n' +
            '                    parent.layer.close(index);\n' +
            '                });\n' +
            '                body.find("#cancel").bind("click", function () {\n' +
            '                    parent.layer.close(index);\n' +
            '                });\n' +
            '            });\n' +
            '        },\n' +
            '        /**\n' +
            '         * 提示\n' +
            '         * @param title\n' +
            '         * @param obj\n' +
            '         */\n' +
            '        tips: function (title, obj) {\n' +
            '            layer.tips(title, obj, {\n' +
            '                tips: [1, \'#444c63\'], //还可配置颜色\n' +
            '                time: 1000\n' +
            '            });\n' +
            '        }\n' +
            '    };\n' +
            '    //输出test接口\n' +
            '    exports(\'dialog\', dialog);\n' +
            '});\n').on('click','.call-association', function () {
            var id = $(this).attr("data-id");
            page.edit("associationStatic","/work/associationNew/wxassociationnew/getstatic?applyId="+applyId+'&id=' + id,"社团统计");
        });







        // 查询
        $('#searchBtn').bind('click', function () {
            getInfo();// 获取数据
            toPage();// 进行分页
        });
        // 重置
        $('#resetBtn').bind('click', function () {
            $("#title").val("");
            getInfo();// 获取数据
            toPage();// 进行分页
        });

    });

    // 进行分页
    function toPage() {
        // 调用分页
        layui.use('laypage', function () {
            var laypage = layui.laypage;
            // 调用分页
            laypage.render({
                // 分页容器的id
                elem: 'page',// *必选参数
                // 数据总数，从服务端得到
                count: total,// *必选参数
                // 每页显示的条数。laypage将会借助 count 和 limit 计算出分页数。
                //limit:limit,
                // 起始页
                //curr:Pager,
                // 连续出现的页码个数
                //groups:5,
                // 自定义每页条数的选择项
                limits: [10, 25, 50, 100],
                // 自定义首页、尾页、上一页、下一页文本
                first: '首页',
                last: '尾页',
                prev: '<em><<</em>',
                next: '<em>>></em>',
                // 自定义主题
                theme: "#FF5722",
                // 自定义排版
                layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'],
                // 渲染数据
                jump: function (data, first) {
                    // data包含了当前分页的所有参数
                    curr = data.curr;
                    limit = data.limit;

                    // 首次不执行
                    if (!first) {
                        getInfo();
                    }
                }
            });
        })
    }





</script>
</body>
</html>